﻿using System.Collections.Generic;
using PgBirdie.Core.Model.Database.AccessControl;
using PgBirdie.Core.Model.Database.Structure;
using PgBirdie.Core.Model.Database.Structure.Constraint;
using PgBirdie.Core.Model.Database.Structure.Index;

namespace PgBirdie.Core.Service.DbObject
{
    public interface IDbObjectFromDbService
    {
        IDictionary<string, PgSequence> GetAllSequences(PgDatabase db);
        IDictionary<string, PgTable> GetAllTables(PgDatabase db);
        IDictionary<string, PgColumn> GetAllColumns(PgDatabase db);
        IDictionary<string, PgIndex> GetAllIndexes(PgDatabase db);
        IDictionary<string, PgConstraintBase> GetAllConstraints(PgDatabase db);

        IDictionary<string, PgPrimaryKey> GetAllPrimaryKeys(PgDatabase db);
        IDictionary<string, PgUniqueKey> GetAllUniqueKeys(PgDatabase db);
        IDictionary<string, PgForeignKey> GetAllForeignKeys(PgDatabase db);

        /// <summary>
        /// Retrievas all owners for all objects that support owner from given database.
        /// </summary>
        IDictionary<string, PgOwner> GetAllOwners(PgDatabase db);

        /// <summary>
        /// Retrievas all privileges for all objects that support privileges from given database.
        /// </summary>
        IDictionary<string, PgPrivilege> GetAllPrivileges(PgDatabase db);
    }
}